#ifndef OCTHREADPOOL_H_INCLUDED
#define OCTHREADPOOL_H_INCLUDED

#include <glib.h>
#include "octaskrange.h"

//#define OC_THREAD_POOL_DEFAULT_NUM_THREADS 0

typedef struct _oc_thread_pool_t oc_thread_pool_t;

struct _oc_thread_pool_t;

typedef void ( *oc_usr_thread_func_t )( void * );

oc_thread_pool_t *oc_thread_pool_new ( //oc_thread_pool_t *tpool,
                            gulong nthreads );
                            //oc_usr_thread_func_t usr_func );
                            //oc_task_range_t *task_range );

void oc_thread_pool_set_num_threads (   oc_thread_pool_t *tpool,
                                        gulong nthreads );

void oc_thread_pool_set_usr_func    (   oc_thread_pool_t *tpool,
                                    oc_usr_thread_func_t usr_func );

void oc_thread_pool_set_task_range  (   oc_thread_pool_t *tpool,
                                        oc_task_range_t *task_range );

void oc_thread_pool_fireup  ( oc_thread_pool_t *tpool
                                );

gulong oc_thread_get_queue_index ();

void oc_thread_pool_barrier( oc_thread_pool_t *tpool );

void oc_thread_pool_destroy( oc_thread_pool_t *tpool );

#endif // OCTHREADPOOL_H_INCLUDED
